#!/bin/sh
# 获取参数
OS_ID=$(grep '^ID=' /etc/os-release | cut -d= -f2 | tr -d '"')

# 根据参数执行不同命令
case $DEVCONTAINER_STATUS in
    "restart")
        echo "Restarting service..."
        $RESTART
        sh -c "tail -f /dev/null"
        ;;
    "start")
        echo "Starting service..."
        $START
        case $OS_ID in
            ubuntu|debian)
            echo 'DEVCONTAINER_STATUS="restart"' | tee -a /etc/environment
            ;;
            centos)
            ;;
            fedora)
            ;;
            *)
            exit 1
            ;;
        esac
        git clone $RepoLink $WorkSpace 
        sh -c "tail -f /dev/null"
        ;;
    *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
        ;;
esac